package com.hbnu.controller;

import com.hbnu.pojo.User;
import com.hbnu.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Controller
public class UserController {

    @Autowired
    private UserService userService;

    @RequestMapping(value = "/param", method = RequestMethod.GET)
//    @GetMapping("/param")
    @ResponseBody
    public String param(@RequestParam("name") String username) {
        return "hello" + username;
    }

    @RequestMapping("/findAllUser")
    @ResponseBody
    public List<User> findAllUser() {

        return userService.findAllUser();
    }
}
